package com.study.demo.valid;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @author liuhongzhen
 * @date 2022/4/26 12:06
 */
@Component
@Aspect
@Slf4j
public class DoubleToIntAspect {

    /**
     * 抽取公共的切入表达式
     */
    @Pointcut("@annotation(com.study.demo.valid.DoubleToInt)")
    public void pointCut(){

    }

    @Before("pointCut()")
    public void doActionBefore(JoinPoint joinPoint){


        System.out.println("方法前。。。。。。");
        log.info("5656565");

        // 获取参数
        Object[] args = joinPoint.getArgs();


        log.info("args:{}",args);

    }



}
